import { connect } from "react-redux";
import Nav from "../../component/home/Nav.jsx";
import { setPageTitle, setLocation } from "../../action/system";

function mapStateToProps(state) {
    return {
        menus: [
            { 
                title: "车辆管理", url: "/vehicle", style: "vehicle"
            },
            { title: "车型管理", url: "/model", style: "model" },
            { title: "实时监控", url: "/monitor", style: "monitor" },
            { title: "运维管理", url: "/service", style: "service" },
            { title: "供应商管理", url: "/provider", style: "provider" },
            { title: "数据分析", url: "/analyze", style: "analyze" },
            { title: "员工管理", url: "/employee", style: "employee" }
        ]
    }
}

function mapDispatchToProps(dispatch) {
    return {
        setPageTitle: (title) => dispatch(setPageTitle(title)),
        setLocation: (location) => dispatch(setLocation(location))
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(Nav);